package com.example.lyonlinemusic.mapper;

import com.example.lyonlinemusic.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MusicMapper {
    //插入音乐
    public int insert(String title,String singer,String time,String url,int userid);

    //查找当前音乐是否已经存在
    public Music selectByTitleAndSinger(String title, String singer);


    //根据id查找音乐
    public Music findMusicById(int id);

    //根据id删除当前音乐
    public int deleteMusicById(int musicId);

    //查询所有音乐
    List<Music> findMusic();

    //查询指定音乐名的音乐，支持模糊查询
    public List<Music> findMusicByName(String musicName);

}
